let nums = [1,2,3,1]
let left = 0
let right = nums.length - 1
while(left < right){
    let mid = left + Math.floor((right - left) / 2)
    if(nums[mid] < nums[mid + 1]){
        left = mid + 1
    }else{
        // 峰值在左侧或就是mid
        right = mid;

    }
}

console.log(left)
// return left;